package com.aircoinst.userservice.service.impl;

import com.aircoinst.pojo.User;
import com.aircoinst.userservice.mapper.UserMapper;
import com.aircoinst.userservice.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public User getUserById(Integer id) {
        try {
            return userMapper.getUserById(id);
        } catch (Exception e) {
            log.error("数据库查询失败");
            return null;
        }
    }
}
